<template>
	<view>
		<userinfo id="user" :options="user_options" bind:getUserscope="getUserInfo" bind:toLogin="getUserInfo"></userinfo>

		<view class="container" :style="'padding-bottom:' + (isIphoneX ? 184 : 118 ) + 'rpx;'">
			<view class="my-account" :style="'height:' + ( text ==''?'250rpx':'285rpx')">
				<view class="account-bg" :style="'background-color:' + ( mobile_head_color ? mobile_head_color : '#06c1ae' )">
				</view>
				<view class="avatar_box">
					<image class="avater" :src="userInfo.avatar"></image>
				</view>
				<view class="user-info">
					<view class="uname">{{userInfo.nickname}}</view>
					<view class="umoney phone">
						<block v-if="userInfo.showPhone && userInfo.showPhone!=''">
							<text>{{ userInfo.showPhone }}</text>
						</block>
						<block v-else>
							<lang keywords="未绑定手机号码" class="noPhone" @click.stop="go_newnumber"></lang>
						</block>
						<block v-if="myPageInfo.user.sign_get_score > 0">
							<block v-if="myPageInfo.user.sign_today == 1">
								<lang keywords="已签到" class="qiandao"></lang>
							</block>
							<block v-if="myPageInfo.user.sign_today == 0">
								<lang keywords="未签到" class="qiandao" @click.stop="goUrl" data-url="url/My/sign" data-url_title="签到"></lang>
							</block>
						</block>
					</view>
				</view>
				<view class="set_up" @click.stop="go_myinfo">
					<image src="https://hf.pigcms.com/tpl/Wap/pure/static/images/new_my/set_up.png"></image>
				</view>
				<view class="money bd-radius" :style="(text==''?'':'padding-bottom:0px')">
					<view :class="'my_detail clearfix ' + (text==''?'':'tjt-cells rel ')" style="padding:0px;">
						<view class="item" style="width:33.3333%;margin-top:0px;padding:24rpx 0rpx 10rpx 0rpx;">
							<view class="big_words">{{myPageInfo.user_link.now_money}}</view>
							<view class="words">{{myPageInfo.user_link.now_money_name}}</view>
							<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="myPageInfo.user_link.now_money_url"
							 :data-url_title="'我的' + myPageInfo.user_link.now_money_name ">
								<button formType="submit" class="formidBtn"></button>
							</form>
						</view>
						<view class="item" style="width:33.3333%;margin-top:0px;padding:24rpx 0rpx 10rpx 0rpx;">
							<view class="big_words">{{myPageInfo.user_link.score}}</view>
							<view class="words">{{myPageInfo.user_link.score_name}}</view>
							<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="myPageInfo.user_link.score_url"
							 :data-url_title="'我的' + myPageInfo.user_link.score_name ">
								<button formType="submit" class="formidBtn"></button>
							</form>
						</view>
						<view class="item" style="width:33.3333%;margin-top:0px;padding:24rpx 0rpx 10rpx 0rpx;">
							<view class="big_words">{{myPageInfo.user.level}}</view>
							<view class="words">{{myPageInfo.user_link.level_name}}</view>
							<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="myPageInfo.user_link.level_url"
							 :data-url_title="'我的' + myPageInfo.user_link.level_name ">
								<button formType="submit" class="formidBtn"></button>
							</form>
						</view>
					</view>

					<view class="example " v-if="text!=''">
						<view style="position:absolute;left:10px;z-index:100;background-size: 14px; padding-left: 10px;background:#fff;width:30px;height:30px">
							<view style="height:100%;overflow:hidden">
								<image :src="myPageInfo.scroll_image" style="width:20px;height:16px;padding-top:7px"></image>
							</view>
						</view>
						<view class="marquee_box" :style="'width:' + windowWidth-55 + 'px;height:30px;overflow:' + hidden">
							<view class="marquee_text" :style="orientation + ':' + marqueeDistance2 + 'px;font-size: ' + size + 'px'">
								<text class="every" style="white-space:pre;font-size: 12px;">{{text}}</text>
							</view>
						</view>
					</view>

				</view>
			</view>

			<view :style="(text==''?'margin:92rpx 10px 0px 10px ':'margin:120rpx 10px 0px 10px ')">
				<view class="my_item bd-radius" v-if="myPageInfo.order">
					<view class="my_title tjt-cells rel">
						<view>
							<lang keywords="我的订单"></lang>
						</view>
					</view>
					<view class="my_detail clearfix">
						<block v-for="(item, myPageInfo_order) in myPageInfo.order" :key="myPageInfo_order">
							<view class="item" :style="'width:25%;' + ( index >= 4 ? 'margin-top:40rpx' : '')">
								<image class="wh25" :src="item.image"></image>
								<view>{{ item.title }}</view>
								<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="item.url" :data-url_title="item.title">
									<button formType="submit" class="formidBtn"></button>
								</form>
							</view>
						</block>
					</view>
				</view>
				<view class="my_item bd-radius" v-if="myPageInfo.collection && myPageInfo.collection.length > 0">
					<view class="my_title tjt-cells rel">
						<view>
							<lang keywords="收藏关注"></lang>
						</view>
					</view>
					<view class="my_detail clearfix" style="display:block;margin-top:0px">
						<view class="flex item" style="align-items: baseline;color:#5f5f5f;margin-top:0px ">
							<block v-for="(item, myPageInfo_collection) in myPageInfo.collection" :key="myPageInfo_collection">
								<view class="myActiveItem">
									<text class="shoucang" :style="'color:' + (idx==0?'#3F9CFF':idx==1?'#FF5E5E':idx==2?'#A378FF':'#FFBA2A')">{{item.count}}</text>
									<view>{{ item.title }}</view>
									<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="item.url" :data-url_title="item.title">
										<button formType="submit" class="formidBtn"></button>
									</form>
								</view>
							</block>
						</view>
					</view>
				</view>
				<view class="my_item bd-radius" v-if="myPageInfo.discount && myPageInfo.discount.length>0">
					<view class="my_title tjt-cells rel">
						<view>
							<lang keywords="我的卡券"></lang>
						</view>
					</view>
					<view class="my_detail clearfix" style="display:block;">
						<view class="flex" style="font-size:28rpx;align-items: baseline;color:#5f5f5f ">
							<block v-for="(item, myPageInfo_discount) in myPageInfo.discount" :key="myPageInfo_discount">
								<block v-if="myPageInfo.discount.length>=4">
									<view class="myCardItem">
										<block v-if="item.add_group">
											<image class="wh43" :src="item.pic_url" style="width:30px;height:30px"></image>
										</block>
										<block v-else>
											<image class="wh43" :src="item.pic_url"></image>
										</block>
										<view>{{ item.title }}</view>
										<view style="font-weight:normal;color:#666">
											<lang keywords="共"></lang><text style="color:red;">{{item.number}}</text>
											<lang keywords="张"></lang>
										</view>
										<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="item.url" :data-url_title="item.title">
											<button formType="submit" class="formidBtn"></button>
										</form>
									</view>
								</block>
								<block v-else>
									<view class="flex1">
										<image class="wh43" :src="item.pic_url"></image>
										<view>{{ item.title }}</view>
										<view style="font-weight:normal;color:#666">共<text style="color:red">{{ item.number }}</text>张</view>
										<form :report-submit="true" class="formidForm" bindsubmit="goUrl" :data-url="item.url" :data-url_title="item.title">
											<button formType="submit" class="formidBtn"></button>
										</form>
									</view>
								</block>
							</block>
						</view>
					</view>
				</view>
				<view class="my_item bd-radius" style="padding-bottom:0px;margin-bottom:0px" v-if="myPageInfo.release &&  myPageInfo.release.length>0">
					<view class="weui-cells no-border-t no-border-b">
						<block v-for="(item, myPageInfo_release) in myPageInfo.release" :key="myPageInfo_release">
							<view :class="'weui-cell weui-cell_access  ' + (idx==0?'no-border-t':'') + '  ' + (idx==myPageInfo.release.length-1?'':'no-border-b') + '  '">
								<view class="weui-cell__hd">
									<image class :src="item.image"></image>
								</view>
								<view class="weui-cell__bd weui-cell_primary">
									<view>{{ item.title }}</view>
								</view>
								<text class="weui-cell__ft"></text>
								<form :report-submit="true" class="formidForm" :bindsubmit="( item.phone?'goPhone':'goUrl' )" :data-phone="(item.phone?item.phone:'')"
								 :data-url="item.url" :data-url_title="item.title">
									<button formType="submit" class="formidBtn"></button>
								</form>
							</view>
						</block>
					</view>
				</view>

			</view>
			<!-- 店铺联系方式弹窗 -->
			<view class="mask contact-box" :hidden="!showCallBox">
				<view class="detail">
					<buttton class="item" @tap="callPhone" v-for="(item, phoneList) in phoneList" :key="phoneList" :data-phone="item">
						<text class="iconfont icon-dianhua"></text>
						<text>{{item}}</text>
					</buttton>
					<block v-if="phoneUrl!=''">
						<buttton :class="'item  ' + (phoneUrl==''?'active':'')" @click.stop="phoneUrl==''?'':'goUrl'" :data-url="(phoneUrl==''?'':phoneUrl)"
						 data-url_title="在线客服">
							<text class="iconfont icon-weixin1"></text>
							<block v-if="phoneUrl==''">
								<lang keywords="暂未开通在线客服"></lang>
							</block>
							<block v-else>
								<lang keywords="在线客服"></lang>
							</block>
						</buttton>
					</block>

					<text class="iconfont icon-cha" @click.stop="closeMask"></text>
				</view>
			</view>


			<auth_btn is="auth_btn" :data="{showAuthBtn:showAuthBtn}"></auth_btn>
		</view>
	</view>
</template>


<script>
	export default {
		props: ["userInfo.nickname", "userInfo.showPhone", "myPageInfo.user_link.now_money",
			"myPageInfo.user_link.now_money_name", "myPageInfo.user_link.score", "myPageInfo.user_link.score_name",
			"myPageInfo.user.level", "myPageInfo.user_link.level_name", "text", "item.title", "item.count", "item.title",
			"item.title", "item.number", "item.title", "item.number", "item.title", "item"
		]
	}
</script>
